import React from 'react'
import { HashRouter  } from 'react-router-dom'
// ===================================================================== Lazy
const { $Lazy } = window
const AppRouter 	= $Lazy.load(()=>import('./router'))
const Lang 			= $Lazy.load(()=>import('@antd/lang'))
const Toast 		= $Lazy.load(()=>import('@tp/toast'))
const DataLoading 	= $Lazy.load(()=>import('@tp/data-loading'))
const LockModal 	= $Lazy.state(()=>import('@views/_public/lock-modal'))
const SystemModal  = $Lazy.state(()=>import('@views/_public/system-modal'))
// ===================================================================== 二级路由
const App = ( ) => {
	return (
		<>
			<Lang>
				<HashRouter children={<AppRouter />}/>
			</Lang>
			<Toast />
			<DataLoading />
			<SystemModal onRef = { ref => window.systemRef = ref } />
			<LockModal onRef = { ref => window.lockRef = ref }  />
		</>
	)
}
export default App